<?php
include('template.php');

	$draft = getDraft($_SESSION['team']->draftID);
	$teamOnClock = getPickingTeam($draft);

$playerID = $_GET['id'];
if (is_numeric($playerID))
{
	$player = getPlayer($playerID);
	if ($_SESSION['team']->equals($teamOnClock))
	{
		$message = "<h2>You Selected ".$player." From ".$player->nflTeam."</h2>";
		addSelection($playerID, $_SESSION['team'], $draft);
	}
	else if ($_SESSION['user']->role == "admin")
	{
		$message = "<h2>".$teamOnClock." Selected ".$player." From ".$player->nflTeam."</h2>";
		addSelection($playerID, $teamOnClock, $draft);
	}
	else
	{
		$message = "<h2> Please wait your turn </h2>";
	}
}
?>
<html>
<?
	$draft = getDraft($_SESSION['team']->draftID);
	$teamOnClock = getPickingTeam($draft);
	echo getHeader();
?>
<body>
	<?echo getToolbar($draft, $ie, 0);?>
	<div class="container-fluid">
		<?echo getNavBar($draft);?>
		<div class="content">
			<?echo getClockMessage($teamOnClock);?>
			<?echo $message?>
			<a class="button" href="draftpage.php" onclick="this.blur();"><span>Back To Draft</span></a>
		</div>
	</div>
	
</body>
</html>
